<extend name="Layout:layout_edit" />
<block name="body_content_block">
    <form action="{:AddonU('Extension/seat_save')}" method="post">
        <table>
            <tr>
                <th>分机号：</th><td>
                <input type="text" class="easyui-textbox" name="userName" placeholder="请输入用户名" value="{$data.userName}" title="请填写3-16个字符!" />
            </td></tr>
            <tr>
                <th>姓名：</th><td>
                <input type="text" class="easyui-textbox" name="personalName" placeholder="请输入姓名" title="请填写真实姓名!" value="{$data.personalName}" />
            </td></tr>
            <tr>
                <th>队列号：</th><td>
                <select name="teamNumber" title="请选择队列号码" data-url="{:AddonU('Queue/get_queue_json')}" data-value="{$data.teamNumber}"></select>
            </td></tr>
            <tr>
                <th>班长模式：</th><td>
                <input type="radio" name="ctiModel" value="Leader" required />是
                <input type="radio" name="ctiModel" value="SEAT" checked="checked" required />否
            </td></tr>
            <tr>
                <th>状态：</th><td>
                <input type="radio" name="state" value="1" checked="checked" required />正常
                <input type="radio" name="state" value="0" required />禁用
            </td></tr>
        </table>
        <input type='hidden' value='{$data.id}' name='id' />
    </form>
</block>
<block name="body_after_block">
    <script>
    // 设置主键控件状态
    if ('' != '{$data.userName}') {
        $('input[name="userName"]').attr("readonly", true);
    }
    $('input[name="state"][value="{$data.state}"]').attr('checked', true);
    $('input[name="ctiModel"][value="{$data.ctiModel}"]').attr('checked', true);
    ajax_load_options({selector:'select[name="teamNumber"]', queryParams:{siteID:'{$data.siteID}'}, def_option:'请选择队列号'});

</script>
</block>